#!/bin/sh

[ -d /tmp/book ] || (git worktree prune && git branch -D gh-pages)

git worktree add -b gh-pages /tmp/book
rm -rf /tmp/book/* # this won't delete the .git directory
cp -rp rust-code-analysis-book/book/* /tmp/book/
cd /tmp/book
git add -A
git commit -m "Deploy rust-code-analysis"
